package br.com.bco.negocio;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.joda.time.DateTime;

@Entity
@Table(name = "SAIDAS_BCO")
public class Saida extends ObjetoPersistente {

    private static final long serialVersionUID = -959484934008662140L;
    private DateTime horaSaida;
    private Linha linha;
    private Terminal terminal;

    @Transient
    public DateTime getHoraSaida() {
        return horaSaida;
    }

    public void setHoraSaida(DateTime horaSaida) {
        this.horaSaida = horaSaida;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "LINHA_ID")
    public Linha getLinha() {
        return linha;
    }

    public void setLinha(Linha linha) {
        this.linha = linha;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "TERMINAL_ID")
    public Terminal getTerminal() {
        return terminal;
    }

    public void setTerminal(Terminal terminal) {
        this.terminal = terminal;
    }

}
